package stage1.module5.Q2;

import java.util.Objects;

public class VideoOrder {

    private String tradeNo;
    private int price;
    private String title;

    public VideoOrder(String tradeNo, int price, String title) {
        this.tradeNo = tradeNo;
        this.price = price;
        this.title = title;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public int getPrice() {
        return price;
    }

    public String getTitle() {
        return title;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VideoOrder that = (VideoOrder) o;
        return price == that.price && Objects.equals(tradeNo, that.tradeNo) && Objects.equals(title, that.title);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tradeNo, price, title);
    }

    @Override
    public String toString() {
        return tradeNo + ", " + title + ", " + price;
    }
}
